<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>5.动画</title>
    <style>
      *{
        margin: 0;
        padding: 0;
      }
      h1 {
        background-image: linear-gradient(45deg,red,yellow,green);
        box-shadow: 0 0 5px;
      }
      @keyframes dongqilai {
        from{
          transform: translateX(0)
        }
        to{
          transform: translateX(-100%)
        }
      }
      .likai {
        animation: dongqilai 1s linear;
        animation-fill-mode: forwards;
      }
      .guolai {
        animation: dongqilai 1s linear reverse;
      }
    </style>
  </head>
  <body>
    <h1>你好</h1>
  </body>
</html>